<template>
    <a-card :bordered="false">
        <!-- 查询区域 -->
        <div class="table-page-search-wrapper">
            <h2 class="text-center  margin-bottom">
                {{title}}
            </h2>

            <a-form layout="inline" @keyup.enter.native="searchQuery">
                <a-row :gutter="24">
                    <a-col :md="6" :sm="24">
                        <a-form-item label="交接编号">
                            <a-input v-model="queryParam.transferNumber" placeholder="交接编号"/>
                        </a-form-item>
                    </a-col>
                    <a-col :md="6" :sm="24">
                        <a-form-item label="交接人">
                            <a-input v-model="queryParam.recyclePersonName" placeholder="交接人"/>
                        </a-form-item>
                    </a-col>
                    <a-col :md="6" :sm="24">
                        <a-form-item label="接收人">
                            <a-input v-model="queryParam.receivedBy" placeholder="接收人"/>
                        </a-form-item>
                    </a-col>
                </a-row>
            </a-form>
        </div>
        <!-- 查询区域-END -->

        <!-- 操作按钮区域 -->
        <div class="table-operator">
            <a-button type="primary" @click="searchQuery" icon="search">查询数据列表</a-button>
        </div>

        <!-- table区域-begin -->
        <div>
            <a-table
                    ref="table"
                    size="middle"
                    bordered
                    rowKey="id"
                    :columns="columns"
                    :dataSource="dataSource"
                    :pagination="ipagination"
                    :loading="loading"
                    class="j-table-force-nowrap"
                    @change="handleTableChange"
            >
                <template slot="htmlSlot" slot-scope="text">
                    <div v-html="text"></div>
                </template>
                <template slot="imgSlot" slot-scope="text">
                    <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
                    <img v-else :src="text" height="25px" alt style="width: auto;height: 50px;"/>
                </template>
            </a-table>
        </div>


    </a-card>
</template>

<script>
    /**
     * create by Jane
     */
    import '@/assets/less/TableExpand.less'
    import { JeecgListMixin } from '@/mixins/JeecgListMixin'
    import SelectArea from '@/components/Jane/SelectArea'

    export default {
        mixins: [JeecgListMixin],
        components: {
            SelectArea,
        },
        data() {
            return {
                title: '废物交接记录',
                // 表头
                columns: [
                    {
                        title: '序号',
                        dataIndex: '',
                        key: 'rowIndex',
                        width: 60,
                        align: 'center',
                        customRender: function(t, r, index) {
                            return parseInt(index) + 1
                        }
                    },
                    {
                        title: '交接编号',
                        align: 'center',
                        dataIndex: 'transferNumber',
                    },
                    {
                        title: '交接时间',
                        align: 'center',
                        dataIndex: 'createTime',
                    },
                    {
                        title: '交接人',
                        align: 'center',
                        dataIndex: 'recyclePersonName',
                    },
                    {
                        title: '接收人',
                        align: 'center',
                        dataIndex: 'receivedBy',
                    },
                    {
                        title: '接收车辆',
                        align: 'center',
                        dataIndex: 'carNumber',
                    }
                ],
                url: {
                    list: '/hc/hcTransfer/list'
                }
            }
        },
        mounted() {
        },
        methods: {
            initDictConfig(){
                // 获取到用户登陆的信息
                let userInfo = this.$store.getters.userInfo;
                if(userInfo.companysId){
                    this.queryParam.companysId = userInfo.companysId;
                }
            },
            searchQuery: function() {
                this.loadData(1)
            },
        }
    }
</script>
<style scoped>
    @import '~@assets/less/common.less';
</style>
